package alex.game.updatable.selection
{
	import alex.game.playerIO.PlayerIOManager;
	import alex.game.updatable.plane.BasicPlane;
	import alex.game.util.GameUtil;
	
	import com.framework.IUpdatable;
	
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import playerio.Connection;
	import playerio.Message;
	import playerio.PlayerIO;
	
	public class FFASelectionScreen extends MovieClip implements IUpdatable
	{
		private var affichage:MovieClip;
		private var connection:Connection;
		
		public function FFASelectionScreen()
		{
			
		}
		
		public function create():void
		{
			//this.affichage = new STATE_SELECTION();
			this.addChild(affichage);
			
			this.connection = PlayerIOManager.getInstance().getCurrentConnection();
			
			this.affichage.bt_plane.addEventListener(MouseEvent.CLICK, planeSelectedHandler);
		}
		public function destroy():void
		{
			this.affichage.removeEventListener(MouseEvent.CLICK, planeSelectedHandler);
		}
		
		public function update():void
		{
			//TODO: implement function
		}
		private function planeSelectedHandler(e:Event):void
		{
			connection.createMessage(GameUtil.PROTOCOLE_PICKED_PLANE, BasicPlane.PROTOCOLE_PLANE_SHOCKER);
		}
	}
}